package net;


import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;

public class UDPReceiveTest1 {
    public static void main(String[] args) throws IOException {
        DatagramSocket datagramSocket = new DatagramSocket(9999);
        while (true) {
            byte[] buffer = new byte[1024 * 64];
            DatagramPacket dp = new DatagramPacket(buffer, buffer.length);

            datagramSocket.receive(dp);

            String string = new String(buffer, 0, dp.getLength());
            System.out.println(string);
        }
    }
}
